#include <iostream>
#include <string>

#include <algorithm>
#include <vector>
using namespace std;

class Solution {
public:
    int countEven(int num) {
        int cout = 0;
        int i = 1;
        while (i <= num)
        {
            int sum = 0;
            int n = i;
            while (n)
            {
                sum += n % 10;
                n /= 10;
            }
            if (i <= num && sum % 2 == 0)
            {
                cout++;
            }
            i++;
        }
        return cout;
    }
};

int main()
{
    Solution s1;
    int n = 0;
    cin >> n;
    cout << s1.countEven(n);

    return 0;
}